package com.code.base.dic.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.dic.persistence.DicTrdCodeMapper;
import com.code.base.dic.pojo.DicTrdCode;
import com.code.util.PrimaryKeyUtil;


@Service
public class DicTrdCodeService {


	@Resource
	private DicTrdCodeMapper dicTrdCodeMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public DicTrdCode getDataById(Long id) {
		return dicTrdCodeMapper.getDataById(id);
	}

	public List<DicTrdCode> getAllData() {
		return dicTrdCodeMapper.getAllData();
	}

	public int getDataCountByCondition(DicTrdCode entity) {
		return dicTrdCodeMapper.getDataCountByCondition(entity);
	}

	public List<DicTrdCode> getDataByCondition(DicTrdCode entity) {
		return dicTrdCodeMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(DicTrdCode entity) {
		return dicTrdCodeMapper.getDataCountByLikeCondition(entity);
	}

	public List<DicTrdCode> getDataByLikeCondition(DicTrdCode entity) {
		return dicTrdCodeMapper.getDataByLikeCondition(entity);
	}

	public List<DicTrdCode> getDataByIds(Long[] ids) {
		return dicTrdCodeMapper.getDataByIds(ids);
	}

	public void insertData(DicTrdCode entity) {
		insertData(entity, true);
	}

	public void insertData(DicTrdCode entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		dicTrdCodeMapper.insertData(entity);
	}

	public void updateData(DicTrdCode entity) {
		dicTrdCodeMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		dicTrdCodeMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(DicTrdCode entity) {
		dicTrdCodeMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		dicTrdCodeMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		dicTrdCodeMapper.deleteDataByIds(ids);
	}

}
